@(form: Form[UserInfo])(implicit request: UserRequestHeader)

@main("play-scala-secure-session-example") {

    @request.flash.data.map{ case (k, v) =>
    <p>
        @k: @v
    </p>
    }

    <p>
      Username is @{request.userInfo.map(_.username).getOrElse("undefined")}
    </p>

    @if(request.userInfo.isEmpty) {
        @helper.form(routes.LoginController.login) {
            @helper.CSRF.formField
            @helper.inputText(form("username"))
            <input type="submit"/>
        }
    }

    @if(request.userInfo.isDefined) {
        <form action="@routes.LogoutController.logout" method="post">
            @helper.CSRF.formField
            <input type="submit" value="logout">
        </form>
    }


}
